package divinity.weapons
{
	import flash.geom.Point;
	import divinity.basic.DivinityWorld;
	import divinity.fx.particles.definitions.Standard;
	import flash.events.Event;

	public class PlasmaWeapon extends ParticleWeapon
	{
		private var _fac:Number=1/1000;
		public function PlasmaWeapon(wld:DivinityWorld,firedBy:*,direction:Point)
		{
			super(wld,firedBy,direction);
			speedFactor=0;
			
		}
		override public function init(e:Event)
		{
			super.init(e);
			world.vfx.anim("fireglow",this,200);
		}
		override protected function moving():void
		{
			if(speedFactor<1)
			{
				speedFactor+=_fac*_elapsed;
			}
			else
			{
				speedFactor=1;
			}
			
			super.moving();
		}
		override protected function leaveTrail():void
		{
			world.vfx.makeVFX(this,1,Standard.LONG_TRAIL);
		}
		override protected function hitSolid():void
		{
			world.vfx.anim("explosion",this,700,.7);
			world.vfx.makeVFX(this,30,Standard.EXPLOSION);
			world.vfx.shake(30,6);
			
		}

		public function get fac():Number
		{
			return _fac;
		}

		public function set fac(value:Number):void
		{
			_fac = value;
		}

		
	}
}